package com.example.databasepj.mapper;

import com.example.databasepj.entity.DishReviewEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishReviewMapper {
    List<DishReviewEntity> selectReviewByDishId(int id);
    //根据orderId和dishId选择评价
    DishReviewEntity selectAllByOrder_idAndDish_id(int order_id, int dish_id);
    //更新评价
    void updateDishReview(DishReviewEntity dishReviewEntity);
    //插入评价
    int insertDishReview(DishReviewEntity dishReviewEntity);
    Float getAverageRating(int dishId);

}
